package com.wyc.apidriver.feign;

import com.wyc.internalCommon.request.CarDTO;
import com.wyc.internalCommon.request.DriverUserDTO;
import com.wyc.internalCommon.request.DriverUserWorkStatusDTO;
import com.wyc.internalCommon.result.ApiResult;
import com.wyc.internalCommon.util.PageUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient("service-driver-user")
public interface DriverUserFeignClient {

    /**
     * 新增或修改司机信息
     * @param driverUser
     * @return
     */
    @PostMapping("/user")
    ApiResult insert(@RequestBody DriverUserDTO driverUser);

    /**
     * 查询司机是否存在
     * @param driverPhone
     * @return
     */
    @PostMapping("/check-driver/{driverPhone}")
    ApiResult query(@PathVariable("driverPhone") String driverPhone);

    /**
     * 根据driverId修改司机状态
     * @param workStatusDTO
     * @return
     */
    @PostMapping("/driver-user-work-status")
    ApiResult updateWorkStatus(@RequestBody DriverUserWorkStatusDTO workStatusDTO);

    /**
     * 车辆列表
     * @return
     */
    @GetMapping("/car-list")
    PageUtils list(@RequestParam Map<String,Object> params);

}
